//
//  LoginNavgationView.swift
//  MyTest
//
//  Created by guanzhongwang on 2021/5/8.
//

import UIKit

class LoginNavgationView: UIView {

    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */
    init(_ height:CGFloat) {
        super.init(frame: CGRect.zero)
        let closeBtn = UIButton(type: .custom)
        addSubview(closeBtn)
        closeBtn.snp.makeConstraints({
            $0.left.top.equalTo(0)
            $0.width.height.equalTo(height)
        })
        let image = UIImage(named: "close")
        closeBtn.setImage(image, for: .normal)
        closeBtn.addTarget(self, action: #selector(closePage), for: .touchUpInside)
    }
    @objc func closePage(){
        self.fatherViewController()?.dismiss(animated: true, completion: {
            
        })
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
